﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace MapTool
{
    public class GlobalData : INotifyPropertyChanged
    {
        private static GlobalData? _instance;
        public static GlobalData Instance
        {
            get
            {

                _instance ??= new GlobalData();
                return _instance;
            }
        }

        /// <summary>
        /// 产品路径
        /// </summary>
        public static string ProductPath => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Products");

        /// <summary>
        /// Map图
        /// </summary>
        private MapWafer _map = new MapWafer();
        public MapWafer Map
        {
            get { return _map; }
            set
            {
                _map = value;
                OnPropertyChanged();
            }
        }

        public event PropertyChangedEventHandler? PropertyChanged;
        public void OnPropertyChanged([CallerMemberName] string propertyName = "")
        {

            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}
